package com.example.demo.controller;

import com.example.demo.utils.ImageGenerationsExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PicController {
    @Autowired
    private ImageGenerationsExample imageGenerationsExample;

    @GetMapping("/pic")
    @CrossOrigin
    public String pic(String prompt){
        return imageGenerationsExample.generateImage(prompt);
    }
}
